﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autofac;
using TpWeb.Dal.Context;
using TpWeb.Dal.Repositories;
using TpWeb.Domain.Repositories;

namespace TpWeb.Dal
{
    public class DalModule:Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            builder.RegisterType<tpEntities>().As<DbContext>();            
            builder.RegisterType<CountryRepository>().As<ICountryRepository>();
            builder.RegisterType<ContactRepository>().As<IContactRepository>();
            builder.RegisterType<PersonRepository>().As<IPersonRepository>();
            builder.RegisterType<FiasRepository>().As<IFiasRepository>();
        }
    }
}
